package 贪心算法;

public class 买卖股票的最佳时机II {
    class Solution{
        public int max(int nums[]){
            int count = 0;
            for (int i = 0; i < nums.length; i++) {
                count += Math.max(nums[i] - nums[i-1],0);
            }
            return count;
        }
    }
}
